<?php

namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;
use Symfony\Component\HttpFoundation\Response;
use Illuminate\Validation\ValidationException;
class CustomerManagerRequest extends FormRequest
{

    public function rules()
    {
        $rule = [
            'customer_login_name' => 'required|string|min:1|unique:customer_managers',
        ];
        return $rule;
    }
    public function messages()
    {
        return [
            'unique'=>':attribute 手机号码已经存在',
            'required'=>':attribute 为必填项',
            'min'=>':attribute 长度最少 :min ,不符合要求',
            'customer_login_name.unique'=>"账号不能重复",
        ];

    }
    public function authorize()
    {
        return true;
    }
}
